<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
    <test v-bind="post" :count="count"></test>
    </div>
</body>
<script src="https://unpkg.com/vue@next"></script>
<script>
    const app=Vue.createApp({
        data() {
            return {
                post:{
                    title:'hello Vue.js',
                    likes:'333',
                    a:'A',
                    b:'B',
                    c:'C',
                },
                count:1
            }
        },
        // template:`
        // 动态传值<test :like-val="likes" :title="title" :a="a" :b="b" :c="c"/>
        // 动态传值<test v-bind="post" />
        // `
    })
    app.component('test',{
        data() {
            return {
                myCount:this.count
            }
        },
        props:['title','likeVal','a','b','c','count'],
        template:`
        <div @click="handleAdd">{{title}}---{{myCount}}--{{a}}---{{b}}----{{c}}</div>`,
        methods: {
            handleAdd(){
                console.log(this.count+'--'+this.myCount)
                this.myCount++;
            }
        },
    })
    const vm=app.mount("#app")
</script>
</html>